﻿using DevExpress.XtraGrid.Demos.util;
using DXApplicationTangche.DTO;
using DXApplicationTangche.UC.下单MTO.Service;
using mendian;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DXApplicationTangche.UC.登录
{
    public class 登录Service
    {
        /// <summary>
        /// 根据用户名密码查询使用权限
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        public static SystemUserMessageRestult getSystemUserRight(String userName, String password)
        {
            return
                FunctionHelper.JsonDeserialization<SystemUserMessageRestult>(
                    RestCall.httpGetMethod(
                        URL.接口url + "/store/getSystemUserRightAndShop?userName=" + userName + "&password=" + password
                        )
                    );
        }
        /// <summary>
        /// 更新用户密码
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        public static PlainMessageResult updateSystemUserPassword(String userName, String password)
        {
            return
                FunctionHelper.JsonDeserialization<PlainMessageResult>(
                    RestCall.httpGetMethod(
                        URL.接口url + "/store/updateSystemUserPassword?userName=" + userName + "&password=" + password
                        )
                    );
        }
    }

    public class SystemUserMessageRestult
    {
        public String errorCode { get; set; }
        public String errorMessage { get; set; }
        public String userRightShop { get; set; }
        public SystemUserMessageRestult()
        {

        }
    }
    /// <summary>
    /// 登录权限
    /// </summary>
    public class ConstSystemUserRight
    {
        public const String kashiyama = "坚山";
        public const String kashiyamaSHH = "上海坚山";
        public const String kashiyamaSY = "沈阳坚山";
    }
}
